// import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { MenusService } from './menus.service';
import { CreateMenuDto } from './dto/create-menu.dto';
import { UpdateMenuDto } from './dto/update-menu.dto';
import { SearchMenuDto } from './dto/search-menu.dto';
// import { AuthGuard } from 'src/guard/auth.guard';
// import { Roles } from '../../decorator/roles.decorator';

@Controller('menus')
export class MenusController {
  constructor(private readonly menusService: MenusService) { }

  @Post()
  create(@Body() createMenuDto: CreateMenuDto) {

    console.log(createMenuDto, 'asdasd')
    return this.menusService.create(createMenuDto);
  }

  @Get()
  // @UseGuards(AuthGuard)
  // @Roles(['admin'])
  findAll(@Query() searchMenuDto: SearchMenuDto) {
    return this.menusService.findAll(searchMenuDto);
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.menusService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateMenuDto: UpdateMenuDto) {
    return this.menusService.update(+id, updateMenuDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.menusService.remove(+id);
  }
}
